/**
 * Copyright ©2016-2020 northkingbpo Corporation, All Rights Reserved
 * http://www.northkingbpo.net/
 */
package profile.hujia.redis.service;

import org.springframework.stereotype.Service;
import profile.hujia.redis.dao.model.WorkItem;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * class info
 *
 * @author hujia
 * @date 2018/11/9 12:09
 */
@Service
public class WorkItemBuild {

    public List<WorkItem> createData(int number) {
        List<WorkItem> items = new ArrayList<>();
        Random random = new Random();
        for (int i = 0; i < number; ++i) {
            int tmp = random.nextInt(999);
            WorkItem item = new WorkItem();
            item.setId("id-test-" + i);
            item.setOrgBusiness("orgBusiness" + tmp);
            item.setState(1);
            item.setPriority(10L);
            item.setTransitRefData5("data" + tmp);
            item.setOrganizationalUnit("unit" + tmp);
            item.setBusinessType("businessType" + tmp);
            item.setWorkQueue("workQueue" + tmp);
            item.setName(item.getOrgBusiness() + "-" + item.getWorkQueue() + "-" + item.getBusinessType()
                    + "-" + item.getTransitRefData5());
            items.add(item);
        }
        return items;
    }
}
